package com.bjsxt.service.impl;

import com.bjsxt.mapper.MarriedPersonMapper;
import com.bjsxt.pojo.MarriedPerson;
import com.bjsxt.pojo.PageA;
import com.bjsxt.service.MarriedPersonService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MarriedPersonServiceImpl implements MarriedPersonService {
    @Autowired
    private MarriedPersonMapper marriedPersonMapper;
    @Override
    public PageA<MarriedPerson> findMarriedPersons(Integer page, Integer rows, MarriedPerson marriedPerson) {
        Page pg = PageHelper.startPage(page, rows);
        List<MarriedPerson> list = marriedPersonMapper.selectMarriedPersons(marriedPerson);
        PageA<MarriedPerson> pga = new PageA<>(list,pg.getTotal());
        return pga;
    }
}
